﻿Public Class BewegungsboniTabelleAlles_1
    Inherits BewegungsboniTabelle
    Public Overrides Function GetWert(ByVal Name As String) As Integer
        Return 1
    End Function
    Public Overrides Function ToString() As String
        Return "alles|1"
    End Function
End Class
Public Class BewegungsboniTabelleNahkampf_1
    Inherits BewegungsboniTabelle
    Public Overrides Function GetWert(ByVal Name As String) As Integer
        Dim E As ObjektEinheit = GetUnit(Name)
        If E.MinimaleReichweite = 1 And E.MaximaleReichweite = 1 Then
            If E.Bewegungsart.ToUpper = MovementSorts.Fuss.ToString.ToUpper Then
                Return 0
            ElseIf E.Bewegungsart.ToUpper = MovementSorts.Mech.ToString.ToUpper Then
                Return 0
            ElseIf E.Bewegungsart.ToUpper = MovementSorts.Motorreifen.ToString.ToUpper Then
                Return 0
            Else
                Return 1
            End If
        Else
            Return 0
        End If
    End Function
    Public Overrides Function ToString() As String
        Return "nahkampf|1"
    End Function
    
End Class

Public Class BewegungsboniTabelleCustom
    Inherits BewegungsboniTabelle
    Public Sub New(ByRef Reader As IO.StreamReader)
        While Not Reader.EndOfStream
            Dim Zeile As String = Reader.ReadLine.Trim
            If Zeile.StartsWith("'") Then Continue While
            If Zeile.ToLower.StartsWith("tabellenende") Then Exit While
            Dim Daten As String() = Zeile.Split(":")
            Select Case Daten(0).ToUpper
                Case "ABPZ"
                    ABPZ = Daten(1)
                Case "ART"
                    ART = Daten(1)
                Case "AUFKLAERER"
                    AUFKLAERER = Daten(1)
                Case "BOMBER"
                    BOMBER = Daten(1)
                Case "FLAK"
                    FLAK = Daten(1)
                Case "FLTR"
                    FLTR = Daten(1)
                Case MovementSorts.Hoellium.ToString.ToUpper
                    HOELLIUM = Daten(1)
                Case "HOVERCRAFT"
                    HOVERCRAFT = Daten(1)
                Case "INF"
                    INF = Daten(1)
                Case "JGPZ"
                    JGPZ = Daten(1)
                Case "JAEGER"
                    JAEGER = Daten(1)
                Case "K-HELI"
                    KHELI = Daten(1)
                Case "KPZ"
                    KPZ = Daten(1)
                Case "KREUZER"
                    KREUZER = Daten(1)
                Case "L-BOOT"
                    LBOOT = Daten(1)
                Case "LAEUFER"
                    LAEUFER = Daten(1)
                Case MovementSorts.Mech.ToString.ToUpper
                    MECH = Daten(1)
                Case "MEGAPZ"
                    MEGAPZ = Daten(1)
                Case "MISSILE"
                    MISSILE = Daten(1)
                Case "RKW"
                    RKW = Daten(1)
                Case "SSIEINHEIT"
                    SSI = Daten(1)
                Case "SCHLFF"
                    SCHLFF = Daten(1)
                Case "S-BOMBE"
                    SBOMBE = Daten(1)
                Case "S-BOOT"
                    SBOOT = Daten(1)
                Case "SPAEHER"
                    SPAEHER = Daten(1)
                Case "TARNK"
                    TARNK = Daten(1)
                Case "TITANPZ"
                    TITANPZ = Daten(1)
                Case "T-FLUGZEUG"
                    TFLUGZEUG = Daten(1)
                Case "T-HELI"
                    THELI = Daten(1)
                Case "TTL"
                    TTL = Daten(1)
                Case "TTP"
                    TTP = Daten(1)
                Case "U-BOOT"
                    UBOOT = Daten(1)
                Case "ZEPPELIN"
                    ZEPPELIN = Daten(1)
                Case "ZERSTOERER"
                    ZERSTOERER = Daten(1)
                Case "BAUPANZER"
                    BAUPANZER = Daten(1)
                Case "VERSORGUNGSSCHIFF"
                    VERSORGUNSSCHIFF = Daten(1)
                Case "HOVERFLAK"
                    HOVERFLAK = Daten(1)
                Case "SCHWERESHOVERCRAFT"
                    SCHWERESHOVERCRAFT = Daten(1)
                Case "MOTORRAD"
                    MOTORRAD = Daten(1)
                Case "FLARE"
                    FLARE = Daten(1)
                Case "PANZERABWEHRKANONE"
                    PANZERABWEHRKANONE = Daten(1)
                Case "WASSERFLUGZEUG"
                    WASSERFLUGZEUG = Daten(1)
                Case "KANONENBOOT"
                    KANONENBOOT = Daten(1)
                Case Else
                    MyBase.AddCustomUnit(Daten(0).ToUpper, Daten(1))
            End Select
        End While
    End Sub
    Public Sub Write(ByVal StrW As IO.StreamWriter)
        StrW.WriteLine("ABPZ:" + ABPZ.ToString)
        StrW.WriteLine("ART:" + ART.ToString)
        StrW.WriteLine("AUFKLAERER:" + AUFKLAERER.ToString)
        StrW.WriteLine("BOMBER:" + BOMBER.ToString)
        StrW.WriteLine("FLAK:" + FLAK.ToString)
        StrW.WriteLine("FLTR:" + FLTR.ToString)
        StrW.WriteLine(MovementSorts.Hoellium.ToString.ToUpper + ":" + HOELLIUM.ToString)
        StrW.WriteLine("HOVERCRAFT:" + HOVERCRAFT.ToString)
        StrW.WriteLine("INF:" + INF.ToString)
        StrW.WriteLine("JGPZ:" + JGPZ.ToString)
        StrW.WriteLine("JAEGER:" + JAEGER.ToString)
        StrW.WriteLine("K-HELI:" + KHELI.ToString)
        StrW.WriteLine("KPZ:" + KPZ.ToString)
        StrW.WriteLine("KREUZER:" + KREUZER.ToString)
        StrW.WriteLine("L-BOOT:" + LBOOT.ToString)
        StrW.WriteLine("LAEUFER:" + LAEUFER.ToString)
        StrW.WriteLine(MovementSorts.Mech.ToString.ToUpper + ":" + MECH.ToString)
        StrW.WriteLine("MEGAPZ:" + MEGAPZ.ToString)
        StrW.WriteLine("MISSILE:" + MISSILE.ToString)
        StrW.WriteLine("RKW:" + RKW.ToString)
        StrW.WriteLine("SSIEINHEIT:" + SSI.ToString)
        StrW.WriteLine("SCHLFF:" + SCHLFF.ToString)
        StrW.WriteLine("S-BOMBE:" + SBOMBE.ToString)
        StrW.WriteLine("S-BOOT:" + SBOOT.ToString)
        StrW.WriteLine("SPAEHER:" + SPAEHER.ToString)
        StrW.WriteLine("TARNK:" + TARNK.ToString)
        StrW.WriteLine("TITANPZ:" + TITANPZ.ToString)
        StrW.WriteLine("T-FLUGZEUG:" + TFLUGZEUG.ToString)
        StrW.WriteLine("T-HELI:" + THELI.ToString)
        StrW.WriteLine("TTL:" + TTL.ToString)
        StrW.WriteLine("TTP:" + TTP.ToString)
        StrW.WriteLine("U-BOOT:" + UBOOT.ToString)
        StrW.WriteLine("ZEPPELIN:" + ZEPPELIN.ToString)
        StrW.WriteLine("ZERSTOERER:" + ZERSTOERER.ToString)
        StrW.WriteLine("BAUPANZER:" + BAUPANZER.ToString)
        StrW.WriteLine("VERSORGUNGSSCHIFF:" + VERSORGUNSSCHIFF.ToString)
        StrW.WriteLine("HOVERFLAK:" + HOVERFLAK.ToString)
        StrW.WriteLine("SCHWERESHOVERCRAFT:" + SCHWERESHOVERCRAFT.ToString)
        StrW.WriteLine("MOTORRAD:" + MOTORRAD.ToString)
        StrW.WriteLine("FLARE:" + FLARE.ToString)
        StrW.WriteLine("PANZERABWEHRKANONE:" + PANZERABWEHRKANONE.ToString)
        StrW.WriteLine("WASSERFLUGZEUG:" + WASSERFLUGZEUG.ToString)
        StrW.WriteLine("KANONENBOOT:" + KANONENBOOT.ToString)
        For I = 0 To CUSTOMUNITIDS.Length - 1
            StrW.WriteLine(CUSTOMUNITIDS(I) + ":" + CUSTOMUNITS(I).ToString)
        Next
        StrW.WriteLine("Tabellenende")
    End Sub
End Class